package d4_TCP;

import java.io.DataInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.ServerSocket;
import java.net.Socket;

public class Server {
    public static void main(String[] args) throws IOException {
        System.out.println("Server started......");
        ServerSocket serverSocket = new ServerSocket(4865);
        Socket socket = serverSocket.accept();
        InputStream is= socket.getInputStream();
        DataInputStream dis = new DataInputStream(is);
        System.out.println(dis.readUTF());
        dis.close();
        socket.close();
    }
}
